package me.hl.oneInstance;


/**
 * Created by Planck on 2016/2/14.
 */
public class OneInstanceDemo {

    private static volatile OneInstanceDemo _instance;

    private OneInstanceDemo() {
    }

    public static OneInstanceDemo getinstance() {
        if (_instance == null) {
            synchronized (OneInstanceDemo.class) {
                if (_instance == null) {
                    _instance = new OneInstanceDemo();
                }
            }
        }
        return _instance;
    }
}
